﻿#ifndef DRAWTOOLS_H
#define DRAWTOOLS_H

#include "YToolWidget.h"

namespace Ui {
class DrawTools;
}

class DrawTools : public YToolWidget
{
    Q_OBJECT
public:
    explicit DrawTools(QWidget *parent = nullptr);
    ~DrawTools();
    int getThickness();
    QFont getFont();
    QColor getColor();
    int getVague();

    void setThickness(int thickness);
    void setColor(int index);
    void setVague(int value);

    void setStackIndex(int widget = -1);

signals:
    void thicknessChanged(int);
    void colorChanged(QColor);
    void fontChanged(const QFont&);
    void vagueChanged(int);
    // add by liq 12
    void sigClose();
    // add by liq 14
    void sigScreenshotCancel();
    void sigShiftKeyPressed(bool);
    void sigDoUndoAction();
    void sigDoRedoAction();

public slots:
    void setFont();
    void onUpdateThicknessSetting(int currentThickness);
    void onUpdateColorSetting(QColor currentColor);
    void onUpdateFontsizeSetting(int currentFontsize);

private:
    Ui::DrawTools *ui;
    // modify by liq 13
//    int thickness = 1;
    int thickness = 2;
    QColor color = QColor(255,30,16);
    QFont font;
    int vague;
    bool canEmit = false;

// add by liq 12
    virtual void keyPressEvent(QKeyEvent *e);
    virtual void keyReleaseEvent(QKeyEvent *e);
};

#endif // DRAWTOOLS_H
